<?php

use doumiaoduo\layer\LayerConfirmWidget;
use doumiaoduo\layer\LayerIframeWidget;
use common\components\helpers\Fun;
use common\components\extenders\MenuManage;

use doumiaoduo\layer\LayerAsset;

LayerAsset::register($this);

LayerConfirmWidget::widget();
LayerIframeWidget::widget();
?>
<div class="yx-cnt-box yx-praise-content yx-radius2">
    <div class="yx-praise-box">
        <a href="javascript:history.go(-1);" class="btn yx-back-list yx-radius5 yx-mb0">返回上级</a>
        <div class="yx-member-info">
            <h3 class="yx-pb15">会员基本信息:</h3>
            <div class="yx-member-info-box">
                <table class="yx-member-box yx-member-con" >
                    <tr>
                        <td rowspan="3" class="yx-member-img-name">
                            <img src="<?= !empty($model->logo) ? $model->logo : '/images/images/noperson.png' ?>"
                                 class="yx-member-img">
                            <h3 class="yx-member-nickname">昵称<?= $model->nick_name ?></h3>
                        </td>
                        <td>会员姓名</td>
                        <td><?= $model->name ?></td>
                        <td>性别</td>
                        <td><?= $model->sex == 'Male' ? '男' : '女' ?></td>
                        <td>等级</td>
                        <td></td>
                        <td>加入时间</td>
                        <td><?= \Yii::$app->formatter->asDatetime($model->created_at) ?></td>
                    </tr>
                    <tr>
                        <td>年龄</td>
                        <td><?php
                            $age = '';
                            if ($model->age > 0) {
                                $age = (int)date('Y') - $model->age;
                            }
                            echo $age;
                            
                            ?>岁
                        </td>
                        <td>电话</td>
                        <td><?= $model->mobile ?></td>
                        <td>账户</td>
                        <td><?= $model->account ?></td>
                        <td></td>
                        <td></td>
                    </tr>

                    <tr>
                        <td colspan="9" class="yx-member-info-operation">
                            <?= (new MenuManage(MenuManage::TOP_MENU))->detailsMenu('customer', 'recharge', false, ['rel' => 'dialog-show-iframe', 'class' => 'btn yx-classmagage-about yx-bgf8b551 yx-width80px yx-mr5 yx-mb0 yx-radius2', 'data' => ['id' => \Yii::$app->request->get('id'), 'name' => '充值']], 'cus'); ?>
                            <?= (new MenuManage(MenuManage::TOP_MENU))->detailsMenu('customer', 'binding', false, ['rel' => 'dialog-show-iframe', 'class' => 'btn yx-classmagage-about yx-bg6accbf yx-width80px yx-radius2 yx-mr5 yx-mb0', 'data' => ['id' => \Yii::$app->request->get('id'), 'name' => '绑定学员']], 'cus'); ?>
                        </td>
                    </tr>
                </table>
                <div class="yx-clear"></div>
            </div>
        </div>

        <div class="yx-member-info yx-height612">
            <div class="">
                <h3 class="yx-pb15">学员信息：</h3>
                <?php if ($dataStudent) { ?>
                    <?php foreach ($dataStudent as $item) { ?>
                        <div class="yx-praise-item yx-student-list-item yx-radius3">
                            <div class="yx-teacher-img-box">
                                <img class="yx-teacher-img img-circle <?= $item['sex'] == 1 ?'yx-border1':'yx-border2'?>"
                                                                 src="<?= !empty($item->img) ? $item->img : 'images/images/noperson.png' ?>">
                                <span class="<?= $item['sex'] == '1' ?'yx-teacher-sex-boy':'yx-teacher-sex-girl'?>"></span>
                            </div>
                            <h3 class="yx-teacher-name"><?= $item->name ?></h3>
                            <h4 class="yx-convert-rate">昵称：<?= $item->nickname ?></h4>
                            <h4 class="yx-convert-rate"><?= isset($item->age) ? (int)date('Y') - $item->age . '岁' : '未设置' ?></h4>
                            <div class="yx-admin-list">
                                <?= (new MenuManage(MenuManage::TOP_MENU))->detailsMenu('customer', 'studentdetails', true, ['rel' => '', 'class' => 'btn yx-order-course yx-bg79dae3 yx-radius50', 'data' => ['id' => $item->id, 'name' => '编辑学员']], 'cus'); ?>
                                <?= (new MenuManage(MenuManage::TOP_MENU))->detailsMenu('customer', 'updatestudent', false, ['rel' => 'dialog-show-iframe', 'class' => 'btn yx-order-course yx-bg82d48c yx-radius3', 'data' => ['id' => $item->id, 'name' => '编辑学员']], 'cus'); ?>
                            </div>
                        </div>
                    <?php } ?>
                <?php } ?>
            </div>
        </div>
    </div>
</div>